<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../base/top.jsp" %>
    <style>
        /*#stu_info>tbody>tr>td{*/
        /*border:0px;*/
        /*}*/
        /*#data-table td{*/
        /*padding: 0px !important;*/
        /*!*padding-bottom: 0px;*!*/
        /*!*padding-left: 0px;*!*/
        /*!*padding-right: 0px;*!*/
        /*!*padding-top: 0px;*!*/
        /*margin: 0px;*/
        /*}*/
        /*#data-table ul{*/
        /*list-style: none;*/
        /*margin: 0px;*/
        /*}*/
        /*#data-table li{*/
        /*border-bottom: rgb(221,221,221) 1px solid;*/
        /*height: 40px;*/
        /*padding: 5px;*/
        /*}*/
        /*.td-center{*/
        /*text-align: center;*/
        /*}*/

    </style>
</head>
<body>
<div class="main-container" id="main-container">
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-md-3 col-md-offset-3 center">
                        <img src="static/ace/avatars/avatar.png"  style="height: 200px;" alt="Responsive image">
                    </div>
                    <div class="col-md-3 table-responsive" >
                        <table id="stu_info" class="table">
                            <tbody>
                            <tr>
                                <td style="display: none">学生id:</td>
                                <td id="student-id" style="display: none">${studentBasicDetail.stuId}</td>
                            </tr>
                            <tr>
                                <td style="width:79px;text-align: right;">姓名:</td>
                                <td>${studentBasicDetail.stuName}</td>
                            </tr>
                            <tr>
                                <td style="width:79px;text-align: right;">性别:</td>
                                <td>${studentBasicDetail.stuSex}</td>
                            </tr>
                            <tr>
                                <td style="width:79px;text-align: right;">学号:</td>
                                <td>${studentBasicDetail.stuId}</td>
                            </tr>
                            <tr>
                                <td style="width:79px;text-align: right;">班级:</td>
                                <td>${studentBasicDetail.stuClass}</td>
                            </tr>
                            <tr>
                                <td style="width:79px;text-align: right;">挂科数:</td>
                                <td>${studentBasicDetail.stuFailNumber}</td>
                            </tr>
                            <tr>
                                <td style="width:79px;text-align: right;">学业导师:</td>
                                <td>${studentBasicDetail.teaName}</td>
                            </tr>
                            <tr>
                                <td style="width:79px;text-align: right;">联系方式:</td>
                                <td>${studentBasicDetail.stuTelephone}</td>
                            </tr>
                            </tbody>

                        </table>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
                <div class="row">
                    <div class="col-xs-12">
                        <%--datatable--%>
                        <div id="result_admin">
                            <table id="data-table" width="80%" style="margin-left: 10%" class="table table-striped table-bordered">
                                <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>项目名</th>
                                    <th>创建时间</th>
                                    <th>更新时间</th>
                                    <th>所属课程</th>
                                    <th>课程分数</th>
                                </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- /.col -->
                </div>
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->
</div>
<!-- 页面底部js¨ -->
<%@ include file="../base/foot.jsp" %>
<!-- 删除时确认窗口 -->
<script src="static/ace/js/bootbox.js"></script>
<!-- ace scripts -->
<script src="static/ace/js/ace/ace.js"></script>
<!--提示框-->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>


<script>
    var table = null;
    var columnsData =  [
        {
            bSortable : false,
            data: null,
            width : "40px",
            className: 'text-center whiteSpace',
            render:function(data,type,row,meta) {
                return meta.row + 1 +
                    meta.settings._iDisplayStart;
            }
        },
        {'data': 'projectName',
            render:function(data,type,row,meta) {
                var html = "";
                html += "<a href='javascript:void(0);' onclick='showAssignment(this)'>"+data+"</a>";
                return html;
            }

        },
        {'data': 'projectCreateTime',

        },
        {'data': 'projectUpdateTime',

        },
        {'data': 'teachCourseName',
            className:'td-center'
        },
        {'data': 'selectCourseGrade',
            className:'td-center',
            render : function(data, type, row, meta) {
                if(data == -1.0){
                    return "无记录";
                }else {
                    return data;
                }
            }
        }
    ];
    var dataBaseFiled =  [
        {'column2': 'projectName'},
        {'column3': 'projectCreateTime'},
        {'column4': 'projectUpdateTime'},
        {'column5': 'teachCourseName'},
        {'column6': 'selectCourseGrade'}
    ];
    var url='student/teachCourseProjectList';
    var paramter = {studentId :$("#student-id").text()};
    $(document).ready(function() {
        table = $('#data-table').DataTable($.extend(true,{},CONSTANT.DATA_TABLES.DEFAULT_OPTION,{
            columns:columnsData,
            ajax: function (data,callback) {
                ajax(data,callback,dataBaseFiled,url,paramter);
            },
            //order:[[ 2, "asc" ]]
        }));

        $("td").attr('valign','middle');
    });

    function showAssignment(button) {
        var json =  getClickedRowValue(button);
        //alert(json.projectId);
        window.location.href="<%= basePath%>student/viewProjectAssignments?projectId="+json.projectId;
    }

</script>
</body>
</html>
